//
//  ActiveMessageCell.m
//  Cycling
//
//  Created by 迟国强 on 2023/4/10.
//

#import "ActiveMessageCell.h"

#import "CyclingRouteDetailModel.h"

@interface ActiveMessageCell ()

@property (weak, nonatomic) IBOutlet UIStackView *startContentStackView;
@property (weak, nonatomic) IBOutlet UILabel *durationLbl;
@property (weak, nonatomic) IBOutlet UILabel *startLocationLbl;
@property (weak, nonatomic) IBOutlet UILabel *destinationLocationLbl;
@property (weak, nonatomic) IBOutlet UILabel *totalDistanceLbl;
@property (weak, nonatomic) IBOutlet UILabel *totalDurationLbl;
@property (weak, nonatomic) IBOutlet UILabel *totalClimbingLbl;
@property (weak, nonatomic) IBOutlet UILabel *totalCaloriesLbl;
@property (weak, nonatomic) IBOutlet UILabel *startLocationTitleLbl;
@property (weak, nonatomic) IBOutlet UILabel *destinationLocationTitleLbl;




@end

@implementation ActiveMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.startLocationTitleLbl.text = CycLocalizedString(@"Start Location", @"起点");
    self.destinationLocationTitleLbl.text = CycLocalizedString(@"End Location", @"终点");
}

- (void)setModel:(CyclingRouteDetailModel *)model
{
    if(model.startdate && model.stend) {
        self.durationLbl.text = [NSString stringWithFormat:@"%@ %@", model.startdate, model.stend];
    }
    self.startLocationLbl.text = [NSString stringWithFormat:@"%@", model.user_post];
    self.destinationLocationLbl.text = [NSString stringWithFormat:@"%@", model.end_post];
    self.totalDistanceLbl.text = [NSString stringWithFormat:@"%.1f miles", model.actualdistance.doubleValue / 1000];
    self.totalDurationLbl.text = model.timelength;
    self.totalCaloriesLbl.text = model.calories;
    self.totalClimbingLbl.text = model.num;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
